package com.example.carochess;

public class EvalBoard {
	public int height;
	public int width;
	public int [][] mBoard;
	public EvalBoard(int x,int y){
		height=x;
		width=y;
		mBoard=new int [x][y];
		ResetBoard();
	}
	public void ResetBoard()
    {
        for (int r = 0; r < height ; r++)
            for (int c = 0; c < width; c++)
                mBoard[r][c] = 0;
    }
	
	public void SetBoard(int [][] newBoard){
        for (int i = 0; i < height; i++)
            for (int j = 0; j < width; j++)     
            	mBoard[i][j] = newBoard[i][j];

	}
    public Coordinate MaxPos()
    {
        int Max = 0;
        Coordinate p = new Coordinate(); 
        for (int i = 0; i < height; i++)
        {
            for (int j = 0; j < width; j++)
            {
                if (mBoard[i][ j] > Max)
                {
                    p.setX(i); p.setY(j);
                    Max = mBoard[i][j];
                }
                
            }
        }
        return p;
    }
}
